<!DOCTYPE html>
<html>
<head>
    <title>首页</title>
<#include "head.ftl"/>
</head>
<body>
<div class="layui-header header">
    <div class="layui-logo logo">
        <i class="layui-icon layui-icon-app"></i>
        <span style="font-size: 24px;">XXX管理平台</span>
    </div>
    <div class="menu">
        <ul id="top" class="layui-nav">
            <#--<li class="layui-nav-item">
                <a>平台管理</a>
                <dl class="layui-nav-child">
                    <dd><a data-href="/user/page/query">用户管理</a></dd>
                    <dd><a data-href="/dept/page/query">部门管理</a></dd>
                    <dd><a data-href="/menu/page/query">菜单管理</a></dd>
                    <dd><a data-href="/role/page/query">角色管理</a></dd>
                </dl>
            </li>-->
            <li class="layui-nav-item f-right">
                <a><i class="layui-icon layui-icon-username user-icon"></i>${userName!}</a>
                <dl class="layui-nav-child">
                    <dd><a data-href="/page/changepwd">修改密码</a></dd>
                    <dd><a data-href="/page/logout">退出</a></dd>
                </dl>
            </li>
        </ul>
    </div>

</div>
<div class="layui-tab no-margin layui-tab-card no-shadow no-padding no-border" lay-allowClose="true"
     lay-filter="tabPage">
    <ul class="layui-tab-title">
        <li class="layui-this tab-lock" lay-id="none">首页</li>
    </ul>
    <div class="layui-tab-content no-padding">
        <div class="layui-tab-item layui-show welcome">欢迎使用&nbsp;└(^o^)┘</div>
    </div>
</div>

<script type="application/javascript">
    var menus = ${menus};
    var $top = $("#top");
    for (var i = 0; i < menus.length; i++) {
        var menu = menus[i];
        if (menu.pid == undefined) {
            $top.append(
                    "<li id=" + menu.id + " class=\"layui-nav-item\">\n" +
                    "    <a data-href=\"" + menu.path + "\">" + menu.title + "</a>\n" +
                    "    <dl class=\"layui-nav-child\">\n" +
                    "    </dl>\n" +
                    "</li>\n"
            )
        } else {
            $("#" + menu.pid + ">dl").append("<dd><a data-href=\"" + menu.path + "\">" + menu.title + "</a></dd>")

        }
    }
    var $dl =$("#top dl");
    $.each($dl,function(index,obj){
        if($(obj).children().length==0){
            $(obj).remove();
        }
    })

</script>
<script type="text/javascript" src="/js/index.js"></script>

</body>
</html>